home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / t2win_32.zip / _DALONG.FRM < prev    next >
Text File  |  1996-05-14  |  10KB  |  323 lines

  1. VERSION 4.00
  2. Begin VB.Form frmDALong 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Disk array : long"
  5.    ClientHeight    =   4065
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3255
  8.    ClientWidth     =   8130
  9.    Height          =   4470
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4065
  14.    ScaleWidth      =   8130
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2910
  17.    Width           =   8250
  18.    Begin Threed.SSPanel SSPanel1 
  19.       Align           =   1  'Align Top
  20.       Height          =   480
  21.       Left            =   0
  22.       TabIndex        =   2
  23.       Top             =   0
  24.       Width           =   8130
  25.       _Version        =   65536
  26.       _ExtentX        =   14340
  27.       _ExtentY        =   847
  28.       _StockProps     =   15
  29.       ForeColor       =   -2147483640
  30.       BackColor       =   12632256
  31.       Begin VB.ComboBox cmb_Function 
  32.          Height          =   315
  33.          Left            =   1365
  34.          TabIndex        =   3
  35.          Top             =   90
  36.          Width           =   5415
  37.       End
  38.       Begin Threed.SSCommand cmdNP 
  39.          Height          =   300
  40.          Index           =   1
  41.          Left            =   7770
  42.          TabIndex        =   7
  43.          Top             =   90
  44.          Width           =   255
  45.          _Version        =   65536
  46.          _ExtentX        =   450
  47.          _ExtentY        =   529
  48.          _StockProps     =   78
  49.          Caption         =   ">"
  50.          BevelWidth      =   1
  51.          Font3D          =   3
  52.          RoundedCorners  =   0   'False
  53.          Outline         =   0   'False
  54.       End
  55.       Begin Threed.SSCommand cmdNP 
  56.          Height          =   300
  57.          Index           =   0
  58.          Left            =   6930
  59.          TabIndex        =   6
  60.          Top             =   90
  61.          Width           =   255
  62.          _Version        =   65536
  63.          _ExtentX        =   450
  64.          _ExtentY        =   529
  65.          _StockProps     =   78
  66.          Caption         =   "<"
  67.          BevelWidth      =   1
  68.          Font3D          =   3
  69.          RoundedCorners  =   0   'False
  70.          Outline         =   0   'False
  71.       End
  72.       Begin VB.Label Label2 
  73.          Caption         =   "&Select a function"
  74.          Height          =   255
  75.          Left            =   90
  76.          TabIndex        =   5
  77.          Top             =   120
  78.          Width           =   1275
  79.       End
  80.       Begin Threed.SSCommand SSCommand1 
  81.          Default         =   -1  'True
  82.          Height          =   300
  83.          Left            =   7245
  84.          TabIndex        =   4
  85.          Top             =   90
  86.          Width           =   465
  87.          _Version        =   65536
  88.          _ExtentX        =   820
  89.          _ExtentY        =   529
  90.          _StockProps     =   78
  91.          Caption         =   "&Go"
  92.          BevelWidth      =   1
  93.          RoundedCorners  =   0   'False
  94.          Outline         =   0   'False
  95.       End
  96.    End
  97.    Begin VB.Label lbl_Result 
  98.       Appearance      =   0  'Flat
  99.       BackColor       =   &H80000005&
  100.       BackStyle       =   0  'Transparent
  101.       ForeColor       =   &H80000008&
  102.       Height          =   3345
  103.       Left            =   2970
  104.       TabIndex        =   1
  105.       Top             =   630
  106.       Width           =   5055
  107.    End
  108.    Begin VB.Label lbl_Open 
  109.       Appearance      =   0  'Flat
  110.       BackColor       =   &H80000005&
  111.       BackStyle       =   0  'Transparent
  112.       BeginProperty Font 
  113.          name            =   "Courier New"
  114.          charset         =   0
  115.          weight          =   400
  116.          size            =   8.25
  117.          underline       =   0   'False
  118.          italic          =   0   'False
  119.          strikethrough   =   0   'False
  120.       EndProperty
  121.       ForeColor       =   &H80000008&
  122.       Height          =   3345
  123.       Left            =   90
  124.       TabIndex        =   0
  125.       Top             =   630
  126.       Width           =   2715
  127.    End
  128. End
  129. Attribute VB_Name = "frmDALong"
  130. Attribute VB_Creatable = False
  131. Attribute VB_Exposed = False
  132. Option Explicit
  133. Option Base 1
  134.  
  135. Private Const Iteration = 50
  136.  
  137. Dim IsLoaded         As Integer
  138.  
  139. Dim TimerStartOk     As Integer
  140. Dim TimerCloseOk     As Integer
  141.  
  142. Dim TimerHandle      As Integer
  143. Dim TimerValue       As Long
  144.  
  145.       
  146.  
  147. Private Sub cmdNP_Click(Index As Integer)
  148.  
  149.    Call sub_NextPrev(cmb_Function, Index)
  150.  
  151. End Sub
  152.  
  153.  
  154. Private Sub cmb_Function_Click()
  155.    
  156.    If (IsLoaded = False) Then Exit Sub
  157.    
  158.    Call cDisableFI(mdiT2W.Picture1)
  159.    
  160.    lbl_Result = ""
  161.    
  162.    DoEvents
  163.    
  164.    Call TestDALong(cmb_Function.ListIndex - 1)
  165.  
  166.    DoEvents
  167.    Call cEnableFI(mdiT2W.Picture1)
  168.    
  169. End Sub
  170.  
  171.  
  172. Private Sub Form_Activate()
  173.  
  174.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  175.  
  176. End Sub
  177.  
  178. Private Sub Form_Load()
  179.  
  180.    IsLoaded = False
  181.    
  182.    Show
  183.  
  184.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_dalong.t2w")
  185.    
  186.    IsLoaded = True
  187.    
  188. End Sub
  189.  
  190. Private Sub Form_Unload(Cancel As Integer)
  191.  
  192.    Dim intResult        As Integer
  193.  
  194.    intResult = cKillFileAll("c:\t2w_tmp\dalong.tmp")
  195.  
  196. End Sub
  197.  
  198.  
  199. Private Sub SSCommand1_Click()
  200.    
  201.    Call cmb_Function_Click
  202.    
  203. End Sub
  204.  
  205.  
  206.  
  207.  
  208. Private Sub TestDALong(intManagement As Integer)
  209.    
  210.    Dim intResult        As Integer
  211.    Dim strResult        As String
  212.    Dim strOpen          As String
  213.    Dim strDisplay       As String
  214.    
  215.    Dim i                As Integer
  216.    Dim DA               As tagDISKARRAY
  217.    
  218.    intResult = 0
  219.    
  220.    strResult = ""
  221.    strOpen = ""
  222.    strDisplay = ""
  223.       
  224.    DA.nFilename = T2WDirTest + "\dalong.tmp"
  225.    DA.nType = DA_LONG
  226.    DA.nIsTyped = False
  227.    DA.nRows = 100
  228.    DA.nCols = 100
  229.    DA.nSheets = 2
  230.  
  231.    Select Case intManagement
  232.       Case True      'create
  233.          intResult = cDACreate(DA, True)
  234.       Case False     'use
  235.          intResult = cDACreate(DA, False)
  236.       Case 1         'clear all
  237.          intResult = cDACreate(DA, False)
  238.          If (intResult = -1) Then intResult = cDAClear(DA)
  239.       Case 2         'clear sheet 2
  240.          intResult = cDACreate(DA, False)
  241.          If (intResult = -1) Then intResult = cDAClearSheet(DA, 2)
  242.       Case 3         'clear last row
  243.          intResult = cDACreate(DA, False)
  244.          If (intResult = -1) Then intResult = cDAClearRow(DA, DA.nRows, 1)
  245.       Case 4         'clear last col
  246.          intResult = cDACreate(DA, False)
  247.          If (intResult = -1) Then intResult = cDAClearCol(DA, DA.nCols, 1)
  248.       Case 5         'clear last row in all sheets
  249.          intResult = cDACreate(DA, False)
  250.          If (intResult = -1) Then intResult = cDAClearRow(DA, DA.nRows, -1)
  251.       Case 6         'clear last col in all sheets
  252.          intResult = cDACreate(DA, False)
  253.          If (intResult = -1) Then intResult = cDAClearCol(DA, DA.nCols, -1)
  254.    End Select
  255.  
  256.    strDisplay = strDisplay & "Last intResult = " & intResult & vbCrLf & vbCrLf
  257.  
  258.    If (intResult = True) Then
  259.       
  260.       strOpen = strOpen & "daSize       = " & DA.daSize & vbCrLf
  261.       strOpen = strOpen & "Signature    = " & DA.signature & vbCrLf
  262.       strOpen = strOpen & "nFilename    = " & Trim$(cGetInPartR(DA.nFilename, "\", True)) & vbCrLf
  263.       strOpen = strOpen & "nType        = " & DA.nType & vbCrLf
  264.       strOpen = strOpen & "nIsTyped     = " & DA.nIsTyped & vbCrLf
  265.       strOpen = strOpen & "nRows        = " & DA.nRows & vbCrLf
  266.       strOpen = strOpen & "nCols        = " & DA.nCols & vbCrLf
  267.       strOpen = strOpen & "nSheets      = " & DA.nSheets & vbCrLf
  268.       strOpen = strOpen & "rHandle      = " & DA.rHandle & vbCrLf
  269.       strOpen = strOpen & "rElementSize = " & DA.rElementSize & vbCrLf
  270.       strOpen = strOpen & "rFileSize    = " & DA.rFileSize & vbCrLf
  271.       strOpen = strOpen & "rParts       = " & DA.rParts & vbCrLf
  272.       strOpen = strOpen & "rRemain      = " & DA.rRemain & vbCrLf
  273.       strOpen = strOpen & "rSheetSize   = " & DA.rSheetSize & vbCrLf
  274.       strOpen = strOpen & "rTime        = " & DA.rTime & vbCrLf & vbCrLf
  275.  
  276.       If (intManagement = True) Then
  277.       
  278.          Call cDAPut(DA, 1, 1, 1, 12345)
  279.          Call cDAPut(DA, 1, DA.nCols, 1, 56789)
  280.          Call cDAPut(DA, DA.nRows, 1, 1, 54321)
  281.          Call cDAPut(DA, DA.nRows, DA.nCols, 1, 98765)
  282.    
  283.          Call cDAPut(DA, 1, 1, 2, 12345678)
  284.          Call cDAPut(DA, 1, DA.nCols, 2, 34567890)
  285.          Call cDAPut(DA, DA.nRows, 1, 2, 123456789)
  286.          Call cDAPut(DA, DA.nRows, DA.nCols, 2, 987654321)
  287.  
  288.       End If
  289.    
  290.       strDisplay = strDisplay & "R:1  , C:1  , D:1, Value : " & Trim$(cDAGet(DA, 1, 1, 1)) & "   , time : " & DA.rTime & vbCrLf
  291.       strDisplay = strDisplay & "R:1  , C:" & DA.nCols & ", D:1, Value : " & Trim$(cDAGet(DA, 1, DA.nCols, 1)) & "   , time : " & DA.rTime & vbCrLf
  292.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:1  , D:1, Value : " & Trim$(cDAGet(DA, DA.nRows, 1, 1)) & "   , time : " & DA.rTime & vbCrLf
  293.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:1, Value : " & Trim$(cDAGet(DA, DA.nRows, DA.nCols, 1)) & "   , time : " & DA.rTime & vbCrLf
  294.    
  295.       strDisplay = strDisplay & "R:1  , C:1  , D:2, Value : " & Trim$(cDAGet(DA, 1, 1, 2)) & "   , time : " & DA.rTime & vbCrLf
  296.       strDisplay = strDisplay & "R:1  , C:" & DA.nCols & ", D:2, Value : " & Trim$(cDAGet(DA, 1, DA.nCols, 2)) & "   , time : " & DA.rTime & vbCrLf
  297.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:1  , D:2, Value : " & Trim$(cDAGet(DA, DA.nRows, 1, 2)) & "   , time : " & DA.rTime & vbCrLf
  298.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:2, Value : " & Trim$(cDAGet(DA, DA.nRows, DA.nCols, 2)) & "   , time : " & DA.rTime & vbCrLf
  299.  
  300.    End If
  301.  
  302.    Call cDAClose(DA, False)
  303.  
  304.    lbl_Open = strOpen
  305.    lbl_Result = strDisplay
  306.  
  307.    'time the function
  308.  
  309.    TimerHandle = cTimerOpen()
  310.    TimerStartOk = cTimerStart(TimerHandle)
  311.    
  312.    For i = 1 To Iteration
  313.       strResult = cDACreate(DA, False)
  314.       Call cDAClose(DA, False)
  315.    Next i
  316.    
  317.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  318.    
  319.    TimerCloseOk = cTimerClose(TimerHandle)
  320.  
  321. End Sub
  322.  
  323.